<?php

$images_url = base_url('images');
$main_url = base_url('main');
$login_url = base_url('verify');

require "./lib/src/skey.php";
require "./lib/src/recaptchakey.php";
require_once "./lib/recaptcha/recaptchalib.php";

if(! empty($uid) && !empty ($uname) && !empty($lvl))
{
	if($lvl == 1)
	{
		redirect(base_url('otakkanan'),'refresh');
		exit(0);
	}
	
	if($lvl == 2)
	{
		redirect(base_url('partner'),'refresh');
		exit(0);
	}
}


$other_head = "
	<script type='text/javascript'>
		
		function form_validate(form){
			if(form.username.value==''){ alert('Username tidak boleh kosong'); form.username.focus(); return false; }
			if(form.password.value==''){ alert('Password tidak boleh kosong'); form.password.focus(); return false; }
		}
		
	</script>
";



$isipage = '
	
	<div id="login">
				
		<div class="space"></div>
		<div id="login2">
			<div class="title"><span style="margin-top:10px">Login</span></div>
			<div id="login3">
				
				<form action="'.$login_url.'/login2" method="post" enctype="multipart/form-data" onsubmit="return form_validate(this)">
					<ul>
						<li class="left">&nbsp; Username</li>
						<li class="right">
							<input name="username" type="text" placeholder="username" autocomplete="off" size="30" required />
						</li>
					</ul>
					<ul>
						<li class="left">&nbsp; Password</li>
						<li class="right">
							<input name="password" type="password" placeholder="password" autocomplete="off" size="30" required />
						</li>
					</ul>
					<ul>
						<li class="left">&nbsp; Captcha</li>
						<li class="right">'.recaptcha_get_html($publickey).'</li>
					</ul>
					<ul>
						<li class="left">&nbsp;</li>
						<li class="right">&nbsp;</li>
					</ul>
					<ul>
						<li class="left">&nbsp;</li>
						<li class="right">
							<input type="submit" name="kirim" value="LOGIN">
							<input type="reset" name="ulang" value="ULANG">
						</li>
					</ul>
					
				</form>
				
				<div class="blank"></div>
				<div class="linebrown"></div>
					<ul>
						<li class="left">&nbsp;</li>
						<li class="right"><strong>Alternatif Login</strong></li>
					</ul>
					<ul>
						<li class="left">&nbsp;</li>
						<li class="right">
							<a href="'.base_url('verify/login?sc=fb').'" title="Login menggunakan Akun Facebook"><img src="'.base_url().'images/facebook_icon.gif"></a>
							<a href="'.base_url('verify/login?sc=gp').'" title="Login menggunakan Akun Google"><img src="'.base_url().'images/gplus_icon.png"></a>
						</li>
					</ul>
				<div class="blank"></div>
				<div class="linebrown"></div>
					
					<ul>
						<li class="left">
							&nbsp; 
						</li>
						<li class="right">
							<a href="'.base_url('main/lupapass.html').'" style="font-size:14px">Lupa password</a> 
						</li>
					</ul>
				<div class="blank"></div>
				
			</div>
		</div>
		

		<div class="space"></div>

	</div>
';

$data['other_head'] = $other_head;
$data['isi_page'] = $isipage;
$data['site_title'] = 'Login - Dadan Network';
$data['base_url'] = base_url();
$data['tahun_sekarang'] = date("Y");

$this->parser->parse('template/login', $data);

/* End of file login.php */
/* Location: ./application/views/main/login.php */
